package com.lihui.model;

import javafx.scene.layout.Priority;

import java.util.PriorityQueue;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/11/07  10:24
 */
public class Demo01  {
    public static void main(String[] args) {
        Student s1 = new Student("张三",1,21,100);
        Student s2 = new Student("李四",2,20,80);
        Student s3 = s1;
        StudentCompareWithAge studentCompareWithAge = new StudentCompareWithAge();
        System.out.println(studentCompareWithAge.compare(s1,s2));
        System.out.println(studentCompareWithAge.compare(s2,s1));
        System.out.println(studentCompareWithAge.compare(s1,s3));


        // Student s2 = new Student("张三",1,19,100);
//
//        System.out.println(s1 == s2);
//        System.out.println(s1.equals(s2));
//        System.out.println(s1.compareTo(s2));
//        System.out.println("==========================");
//
       PriorityQueue<Student> queue = new PriorityQueue<>(new StudentCompareWithAge());
        queue.offer(s1);
      queue.offer(s2);
       System.out.println(queue);
//
//        System.out.println("===============================");
//       PriorityQueue<Student> queue1 = new PriorityQueue<>();
//        queue1.offer(s1);
//        queue1.offer(s2);
//        System.out.println(queue1);
//        PriorityQueue<Student> queue = new PriorityQueue<>();
//        queue.offer(new Student("张三",1,21,100));
//        queue.offer(new Student("李四",2,20,80));
//        System.out.println(queue);


    }
}
